# 手指抽筋模拟器kivy版.py
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.clock import Clock

FPS = 30
WIDTH = Window.size[0]
HEIGHT = Window.size[1]

class MainBoard(Widget):
	num = 0
	def on_touch_down(self,touch):
		self.num += 1
	def update(self,dt):
		self.clear_widgets()
		lab = Label(text=str(self.num),pos=(WIDTH/3,HEIGHT/2),font_size=50)
		self.add_widget(lab)

class TestApp(App):
	def build(self):
		board = MainBoard()
		Clock.schedule_interval(board.update,1/FPS)
		return board

TestApp().run()